using fwt
using gfx
using swtChartWrapper

class Trial2
{
  public static Void main ()
  {
    // define the series of data points to display
    series := BarSeries
    {
      label = "bar series"
      points = [0.0f, 0.2f, 0.4f, 0.7f, 0.9f, 1.0f, 0.9f, 0.7f, 0.4f]
      color = Color.green
      padding = 0
    }
    // define a window to display the chart in
    Window
    {
      title = "Example Chart"
      size = Size(650, 350)
      Chart
      {
        title.text = "Sideways, Colourful, Bar Chart Example"
        title.font = Font { size = 25; name = "Arial" }
        xAxis.with
        {
          title.text = "Data Points"
          tick.foreground = Color.blue
        }
        yAxis.with
        {
          title.text = "Amplitude"
          tick.font = Font { size = 15; name = "Arial" } 
          tick.labelAngle = 45
        }
        orientation = Orientation.vertical
        background = Color.fromStr("#88AA00")
        plotBackground = Color.yellow
        data = [series]
        // make some adjustments to the legend
        legend.with
        {
          foreground = Color.red
          background = Color.yellow
          position = Position.bottom
        }
      },
    }.open
  }
}
